package com.example.service.impl;

import com.example.entity.Role;
import com.example.entity.User;
import com.example.service.HelloWorld;

import javax.jws.WebService;
import java.util.ArrayList;
import java.util.List;

@WebService
public class HelloWorldImpl implements HelloWorld {

    @Override
    public String say(String str) {
        return "Hello "+str;
    }

    @Override
    public List<Role> getRoleByUser(User user){
        List<Role> roleList = new ArrayList<>();
        if(user.getUserName().equals("root") && user.getPassword().equals("root")){
            roleList.add(new Role(1,"管理员"));
            roleList.add(new Role(2,"公司运维"));
        }else if(user.getUserName().equals("zplogo") && user.getPassword().equals("12345")){
            roleList.add(new Role(3,"公司普通职工"));
        }
        return roleList;
    }

}
